/**
 * Created by fanyongsheng on 2016/5/12.
 */

var strVar = "";
strVar += "";
strVar += "            <div id=\"mainnav\">";
strVar += "                <div id=\"mainnav-menu-wrap\">";
strVar += "                    <div class=\"nano\">";
strVar += "                        <div class=\"nano-content\">";
strVar += "                <ul class=\"nav navbar-top-links\">";
strVar += "                   ";
strVar += "                    <li class=\"tgl-menu-btn\">";
strVar += "                        <a class=\"mainnav-toggle\" href=\"#\">";
strVar += "                            <i class=\"pli-view-list\"><\/i>";
strVar += "                        <\/a>";
strVar += "                    <\/li>";
strVar += "                <\/ul>";
strVar += "                            <ul id=\"mainnav-menu\" class=\"list-group\">";


strVar += "                                <!--Menu list item-->";
strVar += "                                <li>";
strVar += "                                    <a href=\"#\" name='1'>";
strVar += "                                        <i class=\"psi-split-vertical-2\"><\/i>";
strVar += "						                    <span class=\"menu-title\">";
strVar += "												<strong>订单管理<\/strong>";
strVar += "											<\/span>";
strVar += "                                        <i class=\"arrow\"><\/i>";
strVar += "                                    <\/a>";
strVar += "";
strVar += "                                    <!--Submenu-->";
strVar += "                                    <ul class=\"collapse\">";
strVar += "                                        <li><a href=\"javascript:go_url('set_phone_order.html',1,0)\">上门订单<\/a><\/li>";
strVar += "                                        <li><a href=\"javascript:go_url('set_phone_order_shop.html?a=1',1,1)\">到店订单<\/a><\/li>";
strVar += "                                    <\/ul>";
strVar += "                                <\/li>";


strVar += "                                <li>";
strVar += "                                    <a href=\"#\" name='1'>";
strVar += "                                        <i class=\"fa fa-wrench\"><\/i>";
strVar += "						                    <span class=\"menu-title\">";
strVar += "												<strong>维修管理<\/strong>";
strVar += "											<\/span>";
strVar += "                                        <i class=\"arrow\"><\/i>";
strVar += "                                    <\/a>";
strVar += "";
strVar += "                                    <!--Submenu-->";
strVar += "                                    <ul class=\"collapse\">";
strVar += "                                        <li><a href=\"javascript:go_url('set_phone_brand.html',2,0)\">机型品牌设置<\/a><\/li>";
strVar += "                                        <li><a href=\"javascript:go_url('set_phone_maintenance.html?a=1',2,1)\">项目设置<\/a><\/li>";
strVar += "                                    <\/ul>";
strVar += "                                <\/li>";


strVar += "                                <li>";
strVar += "                                    <a href=\"#\" name='1'>";
strVar += "                                        <i class=\"fa fa-recycle\"><\/i>";
strVar += "						                    <span class=\"menu-title\">";
strVar += "												<strong>回收管理<\/strong>";
strVar += "											<\/span>";
strVar += "                                        <i class=\"arrow\"><\/i>";
strVar += "                                    <\/a>";
strVar += "";
strVar += "                                    <!--Submenu-->";
strVar += "                                    <ul class=\"collapse\">";
strVar += "                                        <li><a href=\"javascript:go_url('recycle_brand-version.html',3,0)\">机型品牌设置<\/a><\/li>";
strVar += "                                        <li><a href=\"javascript:go_url('recycle_retrieve-fee.html?a=1',3,1)\">项目设置<\/a><\/li>";
strVar += "                                    <\/ul>";
strVar += "                                <\/li>";

//strVar += "                                <li>";
//strVar += "                                    <a href=\"javascript:go_url('set_phone_brand.html',2)\" name='2'>";
//strVar += "                                        <i class=\"fa fa-tablet\"><\/i>";
//strVar += "						                    <span class=\"menu-title\">";
//strVar += "												<strong>维修<\/strong>";
//strVar += "											<\/span>";
//strVar += "                                    <\/a>";
//strVar += "                                <\/li>";
//
//strVar += "                                <li>";
//strVar += "                                    <a href=\"javascript:go_url('set_phone_maintenance.html',3)\" name='3'>";
//strVar += "                                        <i class=\"fa fa-tasks\"><\/i>";
//strVar += "						                    <span class=\"menu-title\">";
//strVar += "												<strong>维修项目设置<\/strong>";
//strVar += "											<\/span>";
//strVar += "                                    <\/a>";
//strVar += "                                <\/li>";


//strVar += "                                <li>";
//strVar += "                                    <a href=\"javascript:go_url('brand-version.html',4)\" name='4'>";
//strVar += "                                        <i class=\"fa fa-tablet\"><\/i>";
//strVar += "						                    <span class=\"menu-title\">";
//strVar += "												<strong>回收品牌设置<\/strong>";
//strVar += "											<\/span>";
//strVar += "                                    <\/a>";
//strVar += "                                <\/li>";
//
//
//strVar += "                                <li>";
//strVar += "                                    <a href=\"javascript:go_url('set_phone_brand.html',5)\" name='5'>";
//strVar += "                                        <i class=\"fa fa-tasks\"><\/i>";
//strVar += "						                    <span class=\"menu-title\">";
//strVar += "												<strong>回收项目设置<\/strong>";
//strVar += "											<\/span>";
//strVar += "                                    <\/a>";
//strVar += "                                <\/li>";


strVar += "                                <li>";
strVar += "                                    <a href=\"javascript:go_url('set_phone_master.html',4)\" name='1'>";
strVar += "                                        <i class=\"fa fa-user\"><\/i>";
strVar += "						                    <span class=\"menu-title\">";
strVar += "												<strong>维修师傅设置<\/strong>";
strVar += "											<\/span>";
strVar += "                                    <\/a>";
strVar += "                                <\/li>";

strVar += "                                <li>";
strVar += "                                    <a href=\"javascript:go_url('set_phone_shop.html',5)\" name='2'>";
strVar += "                                        <i class=\"psi-home\"><\/i>";
strVar += "						                    <span class=\"menu-title\">";
strVar += "												<strong>维修门店设置<\/strong>";
strVar += "											<\/span>";
strVar += "                                    <\/a>";
strVar += "                                <\/li>";


strVar += "                                <li>";
strVar += "                                    <a href=\"javascript:go_url('look_statistics.html',6)\" name='3'>";
strVar += "                                        <i class=\"fa fa-columns\"><\/i>";
strVar += "						                    <span class=\"menu-title\">";
strVar += "												<strong>统计<\/strong>";
strVar += "											<\/span>";
strVar += "                                    <\/a>";
strVar += "                                <\/li>";


strVar += "                                <li>";
strVar += "                                    <a href=\"javascript:go_url('set_carousel_app.html',7)\" name='4'>";
strVar += "                                        <i class=\"fa fa-columns\"><\/i>";
strVar += "						                    <span class=\"menu-title\">";
strVar += "												<strong>轮播设置<\/strong>";
strVar += "											<\/span>";
strVar += "                                    <\/a>";
strVar += "                                <\/li>";


strVar += "                                <li>";
strVar += "                                    <a href=\"javascript:go_url('set_carousel_app.html',7)\" name='4'>";
strVar += "                                        <i class=\"fa fa-columns\"><\/i>";
strVar += "						                    <span class=\"menu-title\">";
strVar += "												<strong>t<\/strong>";
strVar += "											<\/span>";
strVar += "                                    <\/a>";
strVar += "                                <\/li>";

strVar += "";
//strVar += "                                <!--Menu list item-->";
//strVar += "                                <li>";
//strVar += "                                    <a href=\"#\" name='2'>";
//strVar += "                                        <i class=\"psi-split-vertical-2\"><\/i>";
//strVar += "						                    <span class=\"menu-title\">";
//strVar += "												<strong>demo1<\/strong>";
//strVar += "											<\/span>";
//strVar += "                                        <i class=\"arrow\"><\/i>";
//strVar += "                                    <\/a>";
//strVar += "";
//strVar += "                                    <!--Submenu-->";
//strVar += "                                    <ul class=\"collapse\">";
//strVar += "                                        <li><a href=\"javascript:go_url('systemconfigmgt.html',2,0)\">list1<\/a><\/li>";
//strVar += "                                        <li><a href=\"javascript:go_url('systemconfigmgt.html?a=1',2,1)\">list2<\/a><\/li>";
//strVar += "                                        <li><a href=\"javascript:go_url('systemconfigmgt.html?a=2',2,2)\">list3<\/a><\/li>";
//strVar += "                                        <li><a href=\"javascript:go_url('authorizationInfor.html',2,3)\">list4<\/a><\/li>";
//strVar += "                                        <li><a href=\"javascript:go_url('operatormgt.html',2,4)\">list5<\/a><\/li>";
//strVar += "                                    <\/ul>";
//strVar += "                                <\/li>";

strVar += "                            <\/ul>";
strVar += "                        <\/div>";
strVar += "                    <\/div>";
strVar += "                <\/div>";
strVar += "            <\/div>";




$('#mainnav-container').html(strVar);

//初始化左侧菜单
function init_left_menu(i1,i2){
    i1 = i1-1;
    if(i2){
        $('#mainnav-menu').find('.collapse').eq(i1).addClass('in');
        $('#mainnav-menu').find('.collapse').eq(i1).find('li').eq(i2).addClass('active-link');
    }else{
        $('#mainnav-menu').children().removeClass('active-link');
        $('#mainnav-menu').children().eq(i1).addClass('active-link');
    }
    sessionStorage.setItem("i1",'');
    sessionStorage.setItem("i2",'');
}

$('body').show();

var i1 = sessionStorage.getItem("i1") || 1;
var i2 = sessionStorage.getItem("i2") || 0;

init_left_menu(i1,i2);

//页面跳转
function go_url(url,i1,i2){
    sessionStorage.setItem("i1",i1);
    if(i2!=undefined) sessionStorage.setItem("i2",i2);
    location.href = url;
}


var strVar = "";
strVar += "<div id=\"navbar-container\" class=\"boxed\">";
strVar += "            <div class=\"navbar-header1\">";
strVar += 'GO机网运营中心';
strVar += "            <\/div>";
strVar += "            <div class=\"navbar-content clearfix\">";
strVar += "                <ul class=\"nav navbar-top-links pull-right\">";
strVar += "                    <li id=\"dropdown-user\" class=\"dropdown\">";
strVar += "                        <a href=\"#\" data-toggle=\"dropdown\" class=\"dropdown-toggle text-right\">";
strVar += "                                <span class=\"pull-right\">";
strVar += "                                    <img class=\"img-circle img-user media-object\" src=\"../img/av1.png\"";
strVar += "                                         alt=\"Profile Picture\">";
strVar += "                                <\/span>";
strVar += "                            <div id=\"nav_loginInfo\" class=\"username hidden-xs\">admin<\/div>";
strVar += "                        <\/a>";
strVar += "                        <div class=\"dropdown-menu dropdown-menu-md dropdown-menu-right panel-default\">";
strVar += "                            <ul class=\"head-list\">";
//strVar += "                                <li id=\"nav-logout\">";
//strVar += "                                    <a href=\"#\">";
//strVar += "                                        <i class=\"pli-computer-secure icon-lg icon-fw\"><\/i> Lock screen";
//strVar += "                                    <\/a>";
//strVar += "                                <\/li>";
strVar += "                            <\/ul>";
strVar += "                            <div class=\"pad-all text-center\">";
strVar += "                                <a href=\"javascript:void(0)\" onclick='location.href=\"admin_login.html\"' class=\"btn btn-primary\">";
strVar += "                                    <i class=\"pli-unlock\"><\/i> Logout";
strVar += "                                <\/a>";
strVar += "                            <\/div>";
strVar += "                        <\/div>";
strVar += "                    <\/li>";
strVar += "                <\/ul>";
strVar += "            <\/div>";
strVar += "        <\/div>";

$('#navbar').html(strVar);


(function(){
    $(window).resize(function(){
        init_();
    });

    function init_(){
        var width = $(window).width();
        if(width<1300){
            $('#container').removeClass('mainnav-lg').addClass('mainnav-sm');
        }else{
            $('#container').removeClass('mainnav-sm').addClass('mainnav-lg');
        }
    }

    init_();
})();
